/**
 * A FlameThrower figure. extends Tower.
 * @authors Itay Sorani, Nadav Ziv, Yonathan Zarsky
 */
package com.example.models.Towers;

import com.example.models.Tower;
import com.example.models.Unit;
import com.example.models.Units.DaVinciTank;
import com.example.models.Units.Goblin;
import com.example.models.Units.Phoneix;
import com.example.models.Units.Troll;

import android.content.Context;

public class FlameThrower extends Tower {
	
	private static final int FLAME_THROWER_COST = 20;
	private static final int FLAME_THROWER_RANGE = 4;
	private static final int FLAME_THROWER_RATE = 0;
	private static final int FLAME_THROWER_DAMAGE_AGAINST_PHONEIX = 20;
	private static final int FLAME_THROWER_DAMAGE_AGAINST_DA_VINCI_TANK = 20;
	private static final int FLAME_THROWER_DAMAGE_AGAINST_GOBLIN = 18;
	private static final int FLAME_THROWER_DAMAGE_AGAINST_TROLL = 25;
	private static final String FLAME_THROWER_NAME = "FlameThrower";
	private static final float FLAME_THROWER_SHOT_VELOCITY = 5;
	private static final String FLAME_THROWER_SHOT = "FlameThrowerShot";
	
	
	/**
     * Constructs a new FlameThrower according to range, fire rate, name and cost.
     */
	public FlameThrower(Context context) {
		super(context);
		setRange(FLAME_THROWER_RANGE);
		setRate(FLAME_THROWER_RATE * 40);
		setName(FLAME_THROWER_NAME);
		setCost(FLAME_THROWER_COST);
		setShotVelocity(FLAME_THROWER_SHOT_VELOCITY);
		setShotName(FLAME_THROWER_SHOT);
	}
	
	/**
     * returns the damage according to the given unit
     */
	public int getDamage(Unit unit) {
		if (unit instanceof Phoneix) {
			return (FLAME_THROWER_DAMAGE_AGAINST_PHONEIX);
		}
		if (unit instanceof DaVinciTank) {
			return (FLAME_THROWER_DAMAGE_AGAINST_DA_VINCI_TANK);
		}
		if (unit instanceof Goblin) {
			return (FLAME_THROWER_DAMAGE_AGAINST_GOBLIN);
		}
		if (unit instanceof Troll) {
			return (FLAME_THROWER_DAMAGE_AGAINST_TROLL);
		}
		return (0);
		
	}
}
